# Tomcat7

FROM            10.0.16.125:5080/general/ubuntu:16.04
MAINTAINER      Lijc lijc@siccs.cn
# install deb
RUN             apt-get update && apt-get -y install tomcat7
# import java
ADD             jre8.tbz /opt/
RUN             ln -s /opt/jre1.8* /opt/jre
# import config file
RUN             rm -f /etc/default/tomcat7 /etc/tomcat7/server.xml /usr/share/tomcat7/bin/setenv.sh
ADD             server.xml /etc/tomcat7/
ADD             setenv.sh /usr/share/tomcat7/bin/
# create persistent volume directory
RUN             mkdir /opt/pv
RUN             cd /opt/pv && mkdir -p tomcat_app tomcat_log
RUN             mv /var/lib/tomcat7/webapps/ROOT /opt/pv/tomcat_app/
RUN             rm -rf /var/lib/tomcat7/webapps /var/log/tomcat7
RUN             ln -s /opt/pv/tomcat_app /var/lib/tomcat7/webapps
RUN             ln -s /opt/pv/tomcat_log /var/log/tomcat7
# fix
RUN             cd /var/lib/tomcat7 && mkdir temp && chown -R tomcat7.tomcat7 temp/
# import docker entry script
ADD             docker-entrypoint /opt/
RUN             chmod 0755 /opt/docker-entrypoint
EXPOSE          8080
CMD             /opt/docker-entrypoint

